import request from "@/utils/request";

enum API {
    ALLPERMISSION_URL = '/admin/acl/permission',
    ADDMENU_URL = '/admin/acl/permission/save',
    UPDATE_URL = '/admin/acl/permission/update',
    DELETEMENU_URL = '/admin/acl/permission/remove/'
}

export const reqAllPermission = () => request.get(API.ALLPERMISSION_URL)

export const reqAddOrUpdate = (data) => {
    if (data.id) {
        return request.put(API.UPDATE_URL, data)
    } else {
        return request.post(API.ADDMENU_URL, data)
    }
}

export const reqDeleteMenu = (id) => request.delete(API.DELETEMENU_URL + id)
